home *** CD-ROM | disk | FTP | other *** search
- .N:21
- .F:
- .F:...Page $$$...
-
- Chapter VII
- Error Messages
-
- Some of these messages will occur only during Pass Two,
- others repeat, occurring during each pass. In either case, LASS
- gives you the opportunity to rewrite the line and continue the
- assembly. However this only corrects the object code being
- assembled. You must keep notes, and later go back to the source
- file to make the corrections there. Note that if the line you
- are correcting starts with a label you should rewrite it without
- the label. Since the label has already been listed in the label
- array and counted, a repeat of the label will only produce
- another error message.
-
- If your final program fails to run properly and you find
- that a line of code has been completely omitted check to be sure
- that the previous code line ends with a carriage return and line
- feed (0D 0A) or at least one of the two. This error is unlikely
- but I have known it to happen. It is also possible to kill a
- line by putting code on the same line with a label and colon.
- See LABELS in Chapter IV.
-
- There is one error in LASS that I have not been able to
- track down. Twice I have gotten the error message "jump too
- far" with a line number but no code line. Single stepping with
- Debug caused the line to display correctly and any trial
- thereafter failed to repeat the error. If this happens to you,
- you will have to find the source line by the line number alone.
- See Jump too far below.
-
- If the screen suddenly fills with garbage there is an end
- of file marker missing. See Chapter III, End of File.
-
- Messages:
-
- Assuming word for missing B or W
-
- There is no B or W at the end of the op mnemonic to
- identify the pointer operand. For a byte pointer, rewrite
- the line, adding B. If you do not rewrite the line, word
- pointer will be assumed. For instance:
-
- mov [Data_Byte],04 change to movB [Data_Byte],04
-
- Byte address already at nnnn
-
- An ORG statement contained an offset address which has
- already been passed by the object code. To recover, change
- the address to be equal or greater to the byte address.
-
- Duplicate label
-
- This label has been used previously. Rewrite line, using a
- different name, if you wish to continue. Remember that all
- referances to the duplicate name will be translated to the
- address of the first occurrence, so you will have to check
- your source code to correct those operands.
-
- File not found. Press Return when ready for retry.
-
- Your source file was not found on the disk you specified.
- Change the disk and press enter; the program will continue.
- If you made an error in specifying the disk drive or the
- filename, break (press ctrl key and scroll lock key) and
- start over. This would only happen before Lass started to
- assemble any code, so little time is wasted.
-
- Final quote mark missing
-
- No final ' was found at the end of a string or single ascii
- character. The best thing to do is to rewrite the line,
- otherwise spaces and comment bytes will be included in the
- byte count and in the object code.
-
- Invalid displacement
-
- Something is wrong with the displacement number within a
- pointer. Check the size of the number. Remember that just
- one displacement is permitted, not [BX+Label+04].
-
- Invalid number
-
- A number was assumed because the item started with a
- decimal digit. Perhaps a number without an 'H' at the end
- had a letter digit. It is also possible that a number that
- should follow the op code is entirely missing. RET may be
- guilty if no semi-colon precedes a comment:
-
- RET LASS tries to make a number of these words
-
- JMPS would do
-
- A jump is within the one byte limit, but since a short jump
- was not specified, it has been assembled into the 3 byte
- jmp code rather than the 2 byte code for jmps. The line
- cannot be rewritten during assembly, but you can later make
- the change in the source code and reassemble if you wish.
- Or just leave it as is.
-
- Jump too far
-
- A conditional jump or loop is beyond the range of one byte.
- If you ignore the line, there will be continuing errors at
- every line starting with a label, because 2 bytes were
- counted for the jump in Pass One. The best thing to do is
- to rewrite the line, replacing the address.
-
- JZ Other_Place change to JZ $+0
-
- After this assembly is finished, rewrite the source code to
- correct the error and reassemble.
-
- JZ Other_Place change to JNZ $+3
- JMP Other_Place
-
- Label address revised
-
- This is a Pass Two error. The byte count made during Pass
- One turned out to be incorrect. A line may have been
- rewritten during one pass but not the other, or a duplicate
- label error may have produced a miscount. There is no way
- to recover from this problem, except to go back to the
- source code now and make the needed corrections.
-
- No label for EQU statement
-
- Without a label, the value given by the EQU statement can
- never be used. Rewrite, this time labeling the line. If
- there was a label but you mistakenly put it on the previous
- line, you must use a different label now or you will get a
- duplicate label error message for your pains. Make the
- proper correction after assembly in the source file.
-
- Number too large
-
- Remember the limits: 255 or 0FFh for a byte
- 35,535 or 0FFFFh for a word
- For a displacement: -17,768 to 17,767
- or: 7FFFh
-
- Operand Missing
-
- The op code requires one or more operands and one (or more)
- is missing. This message will also appear if there is a
- space between the first operand and its comma.
-
- Sorry, but there was a file access error. Back to DOS
-
- An error in writing to a file or in creating a file is the
- most likely cause of this error. If it occurs the only
- thing to do is to start over, making sure no disk is moved,
- or drive door opened once the program has started. The
- only exception is a disk change called for by the Llinker
- file.
-
- Syntax error
-
- There are a number of ways of producing this error.
- Perhaps too many operands were used, or there was a comma
- at the end of a DB series but no following number. Did you
- try to use a segment register where it is not permitted ?
- Or use an immediate number with an XCHG ? Perhaps the
- register was mispelled where only CL or DX is accepted, or
- a shift or rotate was called for more than 1 time (but not
- CL). Perhaps a single register was mixed with a double
- register, or you tried to PUSH a single register.
-
- Unknown Label
-
- A label found in an operand has not been used to mark a
- code line. Rewrite the line, correcting a misspelling if
- that is the problem, or entering a known label or an
-
- immediate number. A hexadecimal number starting with a
- letter digit could also produce this message. if so,
- rewrite, inserting the missing zero. However, replacing an
- expected 2 byte label with a 1 byte number will cause a
- miscount and a fatal label address revised error. Make a 2
- byte number of it if you wish to continue the assembly.
-
- Unknown op code
-
- Either it is a code Lass does not accept, or the mnemonic
- is misspelled. Perhaps a comment follows a label with no
- semi-colon in between.
-
- Unknown operand
-
- This error will occur if any unrecognized term is used
- where Lass is expecting an operand. For instance:
-
- mov byte pointer [di],0
- or call far Other_Segment
-
-
- Chapter VII
- Basic Linking
-
- For those of us who want the best of all possible worlds,
- let's complicate a program by turning it into a slave routine
- for a Basic program. The routine must end with a far return
- (RETF) so it can be called from a Basic program and find its way
- back again. Since Basic uses the same segment registers that
- the routine will use, any segment register that will be changed
- by the routine must be carefully saved. An example of a small
- routine that whites out the screen is shown, with the relevant
- code marked with "**".
-
- Video EQU 0B000h ;black and white screen memory
- ;use 0B800h if you have a color card
- White:
- PUSH ES ;** save ES for Basic
- mov ax,Video ;0B00 into AX and so into
- mov es,ax ;a segment register
- mov di,0 ;upper left corner of screen
- mov cx,2000d ;80 * 25 spaces on screen
- mov ah,07 ;normal characters, please
- mov al,0DBh ;solid block
- White_loop:
- es: ;point to video segment
- mov [di],ax ;it takes both AH and AL, into
- inc di ;2 bytes, for one character
- inc di
- loop White_loop ;subtract move just made from CX
- ;and continue if not zero
- POP ES ;** the original back again
- RETF ;** a Far Return to Basic
-
- Write and save the routine as White.ASM and assemble it
- into White.COM. There is no easy way to prepare the routine for
-
- slavery, so a few Debug tricks must be used. If you are not
- used to Debug, look over the G,L,N,R,M and U commands in your
- manual. Then from DOS, assuming disk drive A, type:
-
- A> debug whiteB.com ;load routine along with Debug
- -r ;look at the registers.
- ;CX register should hold 0019
- -m 100 119 0e00:0 ;move 19 hex bytes (100 to 119)
- ;to another segment (E00)
-
- If you want to check that this is correct, type:
-
- -u 100 119
-
- The mnemonics for your routine wil be displayed, plus one
- line. The program starts at offset 100, and 100 plus 19 adds up
- to the offset for the first byte beyond the routine. Yes, you
- could move bytes 100 through 118 instead of 119. But whichever
- you do, make a note of 19, the value in the CX register, and of
- E00:0, the new segment:offset address of your routine. The next
- step will be to load Basic.com into Debug, and segment E00 was
- chosen to be just beyond Basic and yet within 64K. If you have
- the room, 5000 or 1000 or 1700 would do as well. Just don't
- forget where you put it. Now load Basic.
-
- -n basic.com ;name it first
- -l ;then load it, staying in Debug
-
- If you want to make sure that your routine is still safe,
- unassemble it again, but this time type:
-
- -u e00:0 ;Ok? Then proceed
- -g ;run Basic
-
- There will be an error message on the screen, but ignore
- it. As long as you see the "Ok" prompt it is all right. Now
- BSave the routine. Type below the prompt, using your notes:
-
- def seg=&H0E00 ;space in "def seg" MUST be there
- bsave "white.bin",0,&H19 ;19 bytes at offset 0
-
- The .BIN extension is suggested to denote a binary rather
- than ascii file, and one which may be called from Basic. If you
- wish, mark a slave source routine differently from your .COM
- programs to remind you that it won't run from DOS. For
- instance, you might rename White.COM WhiteBas.COM or White.BLD.
-
- Now that the routine is ready to be used, write a short
- Basic program to call up the routine. The routine is still in
- memory right now, but it won't stay there, so the program must
- be able to load it before calling, and it can be loaded wherever
- you like. 0E00 was all right as long as there was nothing but
- Basic.com in memory, but that spot might well be trampled on
- when Basic gets going. If you have just 64K, the highest
- available address is 0000:FFFF, or absolute 0FFFF. Absolute
- 0FFE0 would provide 20h bytes for this routine, a bare minimum.
- 0F000 would leave 4K bytes free, with ample space for a Basic
-
- program below it. 0F000 translates as 0000:F000 or 0F00:0000.
- Since we want to use a zero offset, the segment will be defined
- as &H0F00.
-
- The routine must be loaded with the BLoad command. Don't
- forget the offset address after the file name. Then a variable
- must be used to repeat the offset for the CALL command.
-
- 10 REM FLASH
- 100 DEF SEG=&H0F00 'segment address for
- 110 BLOAD "White.bin",0 'mach. lang. subroutine
- 120 OS=0 'offset address for routine
- 130 CALL OS 'call routine at 0F000
- 140 FOR J=1 TO 300:NEXT J 'delay
- 150 CLS
- 160 FOR J=1 TO 300:NEXT J
- 170 GOTO 120 'eternal loop
-
- Save the basic program by typing: save"flash.bas"
-
- For this short program and tiny routine you would have no
- trouble if you tried running the program right now, but in
- general, you should reserve memory before entering Basic. Type:
-
- system ;exit Basic to Debug
- -q ;quit Debug
-
- &H0F00 is the segment address, which translates to offset
- &HF000 within segment 0, where the Basic program will be. Since
- this is where the machine language routine will start, subtract
- one to restrict Basic to at least one byte below it. Now
- reenter Basic by typing:
-
- >A basic flash/M:&HEFFF ;enter, load, reserve memory
-
- then let 'er rip.
-
- It is also possible to reserve memory space from within the
- Basic program with the CLEAR statement. At the start of the
- FLASH program, add
-
- 20 CLEAR ,&HEFFF 'note the comma
-
-
- May Bast guide your fingers.
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 1,900+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
- (713) 665-7017
-